export const projectDeliveryDescriptionFileds = (response) => {
  // 项目交付信息动态数据
  const projectDeliveryInfoDesc = reactive([
    // {
    //   label: '前向合同生效时间',
    //   type: 'datePicker',
    //   filed: 'forward_contract_effective_time',
    //   content: response.forward_contract_effective_time
    // },
    {
      label: '施工单位',
      type: 'input',
      filed: 'construction_unit',
      content: response.construction_unit,
    },
    {
      label: '施工单位联系人',
      type: 'input',
      filed: 'construction_unit_contact',
      content: response.construction_unit_contact,
    },
    {
      label: '施工单位联系电话',
      type: 'input',
      filed: 'construction_unit_phone',
      content: response.construction_unit_phone,
      // validator: 'phone'
    },
    {
      label: '维护单位',
      type: 'input',
      filed: 'maintenance_unit',
      content: response.maintenance_unit,
    },
    {
      label: '维护单位联系人',
      type: 'input',
      filed: 'maintenance_unit_contact',
      content: response.maintenance_unit_contact
    },
    {
      label: '维护单位联系电话',
      type: 'input',
      filed: 'maintenance_unit_phone',
      content: response.maintenance_unit_phone,
      // validator: 'phone'
    },
    {
      label: '业主单位',
      type: 'input',
      filed: 'owner_unit',
      content: response.owner_unit
    },
    {
      label: '业主单位联系人',
      type: 'input',
      filed: 'owner_unit_contact',
      content: response.owner_unit_contact
    },
    {
      label: '业主单位联系电话',
      type: 'input',
      filed: 'owner_unit_phone',
      content: response.owner_unit_phone,
      // validator: 'phone'
    },
    {
      label: '维保费（元）',
      type: 'input',
      filed: 'maintenance_cost',
      content: response.maintenance_cost,
      validator: 'number'
    },
    {
      label: '售前支撑的专业公司',
      type: 'input',
      filed: 'pre_sales_support_professional_company',
      content: response.pre_sales_support_professional_company
    },
    {
      label: '售中支撑的专业公司',
      type: 'input',
      filed: 'mid_sales_support_professional_company',
      content: response.mid_sales_support_professional_company
    },
    {
      label: '售后支撑的专业公司',
      type: 'input',
      filed: 'after_sales_support_professional_company',
      content: response.after_sales_support_professional_company
    },
    {
      label: '实际完成时间',
      type: 'datePicker',
      filed: 'actual_completion_time',
      content: response.actual_completion_time
    },
    // {
    //   label: '项目维护期',
    //   type: 'datePicker',
    //   filed: 'project_maintenance_period',
    //   content: response.project_maintenance_period
    // },
    {
      label: '维护起止时间（对业主）',
      type: 'dateRangePicker',
      filed: 'maintenance_start_end_time_owner',
      content: response.maintenance_start_time_owner && response.maintenance_end_time_owner
        ? response.maintenance_start_time_owner + " - " + response.maintenance_end_time_owner
        : response.maintenance_start_time_owner || response.maintenance_end_time_owner || ""
    },
    {
      label: '维护起止时间（对SI）',
      type: 'dateRangePicker',
      filed: 'maintenance_start_end_time_si',
      content: response.maintenance_start_time_si && response.maintenance_end_time_si
        ? response.maintenance_start_time_si + " - " + response.maintenance_end_time_si
        : response.maintenance_start_time_si || response.maintenance_end_time_si || ""
    },
    {
      label: '项目概述',
      type: 'textarea',
      filed: 'project_overview',
      content: response.project_overview
    },
    {
      label: '遗留问题记录',
      type: 'textarea',
      filed: 'legacy_issue_record',
      content: response.legacy_issue_record
    },
    {
      label: '遗留问题整改计划',
      type: 'textarea',
      filed: 'legacy_issue_correction_plan',
      content: response.legacy_issue_correction_plan
    },
    {
      label: '交维结论',
      type: 'textarea',
      filed: 'handover_and_maintenance_conclusion',
      content: response.handover_and_maintenance_conclusion
    },
    // {
    //   label: '完成时间',
    //   type: 'datePicker',
    //   filed: 'completion_time',
    //   content: response.completion_time
    // },
    // {
    //   label: 'ICT系统交付审核状态',
    //   type: 'input',
    //   filed: 'ICT_system_delivery_audit_status',
    //   content: response.ICT_system_delivery_audit_status
    // },
    // {
    //   label: 'ICT系统交付审核意见',
    //   type: 'input',
    //   filed: 'ICT_system_delivery_audit_opinion',
    //   content: response.ICT_system_delivery_audit_opinion
    // }
  ])

  // 项目交付信息表单对象
  const projectDeliveryInfoForm = reactive({
    // forward_contract_effective_time: '',
    construction_unit: '',
    construction_unit_contact: '',
    construction_unit_phone: '',
    maintenance_unit: '',
    maintenance_unit_contact: '',
    maintenance_unit_phone: '',
    owner_unit: '',
    owner_unit_contact: '',
    owner_unit_phone: '',
    maintenance_cost: '',
    pre_sales_support_professional_company: '',
    mid_sales_support_professional_company: '',
    after_sales_support_professional_company: '',
    actual_completion_time: '',
    // project_maintenance_period: '',
    maintenance_start_end_time_owner: [response.contract_start_time, response.contract_end_time],
    // maintenance_start_time_owner: '',
    // maintenance_end_time_owner: '',
    maintenance_start_end_time_si: [response.contract_start_time, response.contract_end_time],
    // maintenance_start_time_si: '',
    // maintenance_end_time_si: '',
    project_overview: '',
    legacy_issue_record: '',
    legacy_issue_correction_plan: '',
    handover_and_maintenance_conclusion: '',
    // completion_time: '1970-01-02 00:00:00',
    // ICT_system_delivery_audit_status: '',
    // ICT_system_delivery_audit_opinion: ''
  })

  for (const key in projectDeliveryInfoForm) {
    // 只更新未设置默认值的字段
    if (response.hasOwnProperty(key) && projectDeliveryInfoForm[key] === '') {
      projectDeliveryInfoForm[key] = response[key] || ''; // 如果 response 中没有该字段，保持为空字符串
    }
  }

  const projectDeliverySecondInfoDesc = reactive([
    {
      label: '服务经理',
      type: 'input',
      filed: 'maintenance_manager',
      content: response.maintenance_manager
    }
  ])

  const projectDeliveryThirdInfoDesc = reactive([
    {
      label: '建设单位部门经理',
      type: 'input',
      filed: 'construction_department_manager',
      content: response.construction_department_manager
    }
  ])

  const projectDeliveryFourthInfoDesc = reactive([
    {
      label: '省端项目主管',
      type: 'input',
      filed: 'project_supervisor',
      content: response.project_supervisor
    }
  ])

  const projectDeliverySixthInfoDesc = reactive([
    {
      label: '交付经理',
      type: 'input',
      filed: 'construction_project_manager',
      content: response.construction_project_manager
    }
  ])

  return {
    projectDeliveryInfoDesc,
    projectDeliveryInfoForm,
    projectDeliverySecondInfoDesc,
    projectDeliveryThirdInfoDesc,
    projectDeliveryFourthInfoDesc,
    projectDeliverySixthInfoDesc,
  }
}